#include "widget.h"
#include "ui_widget.h"

double Widget::temperatureThreshold = 70.0; // 初始化温度阈值

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    m_pageEnv = new Page_envMonitor ();
    m_pageVideo = new Page_video();
    m_setting = new SettingsDialog();

    connect(m_pageEnv, &Page_envMonitor::backToMainPage, this, [&]() {
        this->show();
        m_pageEnv->close();
    });
    connect(m_pageVideo, &Page_video::backToMainPage, this, [&]() {
        this->show();
        m_pageVideo->close();
    });
    connect(m_setting, &SettingsDialog::backToMainPage, this, [&]() {
        this->show();
        m_setting->close();
    });



}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pBtn_envMonitor_clicked()
{
    this->hide();
    m_pageEnv->show();
}

void Widget::on_pBtn_videoMonitor_clicked()
{
    this->hide();
    m_pageVideo->show();
}

void Widget::on_setting_clicked()
{
    this->hide();
    m_setting->show();
}
